package cn.da.shuai.cool.finance.model;

import cn.da.shuai.cool.common.entity.EntityBase;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * <p>
 * 固定资产表
 * </p>
 *
 * @author 大帅哥
 * @since 2023-05-01
 */
@Getter
@Setter
@TableName("cool_fixed_assets")
@Schema(name = "CoolFixedAsset", description = "固定资产表")
public class CoolFixedAsset extends EntityBase {

    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "资产编码")
    @TableField("asset_code")
    private String assetCode;

    @Schema(description = "资产名称")
    @TableField("asset_name")
    private String assetName;

    @Schema(description = "资产类型")
    @TableField("asset_type")
    private String assetType;

    @Schema(description = "购买日期")
    @TableField("purchase_date")
    private LocalDate purchaseDate;

    @Schema(description = "购买成本")
    @TableField("purchase_cost")
    private BigDecimal purchaseCost;

    @Schema(description = "折旧方法：SL-直线法，DDB-双倍余额递减法")
    @TableField("depreciation_method")
    private String depreciationMethod;

    @Schema(description = "使用年限（月）")
    @TableField("useful_life")
    private Integer usefulLife;

    @Schema(description = "残值")
    @TableField("salvage_value")
    private BigDecimal salvageValue;

    @Schema(description = "累计折旧")
    @TableField("accumulated_depreciation")
    private BigDecimal accumulatedDepreciation;

    @Schema(description = "净值")
    @TableField("net_book_value")
    private BigDecimal netBookValue;

    @Schema(description = "使用部门ID")
    @TableField("department_id")
    private Long departmentId;

    @Schema(description = "状态：1-正常使用，2-维修中，3-已报废")
    @TableField("status")
    private Integer status;
}